package com.example.securityproject.demos.common;

/**
 * @Author: Jiangjb
 * @CreateTime: 2022-06-24  21:34
 * @Description: 响应体类
 */
public enum ResultCode {
    //各种响应根据需求去编写
    HTTP_SUCCESS(200, "请求成功"),
    HTTP_FAIL(500, "请求失败"),
    EXCEPTION_NULLPOINTER(501, "空指针异常"),
    EXCEPTION_UNKNOWN(502, "未知异常");

    private final Integer code;
    private final String message;

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }
}

